package com.youlai.boot.system.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.youlai.boot.system.mapper.BascMapper;
import com.youlai.boot.system.mapper.BreedMapper;
import com.youlai.boot.system.model.QB.Breed;
import com.youlai.boot.system.service.BreedService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;
import java.util.List;
@Service
public class BreedServiceImpl extends ServiceImpl<BreedMapper, Breed> implements BreedService {
    private static final Logger logger = LoggerFactory.getLogger(DeviceServiceImpl.class);
    @Autowired
    private BreedMapper breedMapper;
    @Override
    public boolean saveBreed(Breed breed) {

        breed.setAddtime(LocalDateTime.now());
        return save(breed);
    }

    @Override
    public List<Breed> getAllBreed() {
        return breedMapper.selectList(null);
    }

    @Override
    public boolean deleteBreedById(Integer id) {
        return breedMapper.deleteById(id) >0;
    }
}
